# config.py
import sys
from pathlib import Path

class Config:
    """应用配置类"""
    SECRET_KEY = "your-secret-key-keep-it-safe-123"  # 密钥（必填）
    # 数据库配置（跨系统兼容）
    instance_dir = Path(__file__).parent / 'instance'
    instance_dir.mkdir(exist_ok=True)
    db_path = instance_dir / 'data.db'
    SQLITE_PREFIX = 'sqlite:///' if sys.platform.startswith('win') else 'sqlite:////'
    SQLALCHEMY_DATABASE_URI = SQLITE_PREFIX + str(db_path)
    SQLALCHEMY_TRACK_MODIFICATIONS = False  # 优化性能
    DEBUG = True  # 开发模式调试